package it.heima.xmy.Demo01;

import java.io.*;

public class Practise02 {
    public static void main(String[] args) throws IOException {
        //获取源文件
        File file = new File("F:/test.txt");
        //对源文件进行字符统计
        BufferedReader br = new BufferedReader(new FileReader(file));
        String s = null;
        int len = 0;
        while ((s= br.readLine())!=null){
            len+= s.length();
            System.out.println(s);
        }
        br.close();
        System.out.println(len);
    }
}
